using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class UDF_PKT_ImportMap : EntityTypeConfiguration<UDF_PKT_Import>
    {
        public UDF_PKT_ImportMap()
        {
            // Primary Key
            this.HasKey(t => new { t.spid, t.id });

            // Properties
            this.Property(t => t.spid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.Type)
                .HasMaxLength(50);

            this.Property(t => t.RecordType)
                .HasMaxLength(20);

            this.Property(t => t.FormOptions_Caption)
                .HasMaxLength(50);

            this.Property(t => t.Page_Name)
                .HasMaxLength(50);

            this.Property(t => t.FieldType_Name)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_ControlType)
                .HasMaxLength(20);

            this.Property(t => t.FieldType_DataType)
                .HasMaxLength(20);

            this.Property(t => t.FieldType_Category)
                .HasMaxLength(20);

            this.Property(t => t.FieldType_ValueList)
                .HasMaxLength(5000);

            this.Property(t => t.FormOptions_ReportCode)
                .HasMaxLength(30);

            this.Property(t => t.FormOptions_CustomReport)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_NoteSelectionCode)
                .HasMaxLength(50);

            this.Property(t => t.FieldType_Message)
                .HasMaxLength(200);

            this.Property(t => t.FieldType_ReportCode)
                .HasMaxLength(30);

            this.Property(t => t.FieldType_StatsCode)
                .HasMaxLength(30);

            this.Property(t => t.FieldType_ImageFile)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Name_Arabic)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Visibility)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.FieldType_DefaultValue)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Link_Object)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Link_Command)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Link_Param1)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Link_Param2)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Link_Param3)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Condition_Control)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Lookup_Code)
                .HasMaxLength(100);

            this.Property(t => t.FormOptions_Background_Image)
                .HasMaxLength(100);

            this.Property(t => t.FormOptions_Print_Orientation)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.FieldType_ArabicName)
                .HasMaxLength(100);

            this.Property(t => t.FieldType_Datafield)
                .HasMaxLength(50);

            this.Property(t => t.FormOptions_Table)
                .HasMaxLength(50);

            this.Property(t => t.FieldType_CaptionVisibility)
                .HasMaxLength(1);

            this.Property(t => t.FieldType_PrintLayout)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("UDF_PKT_Import");
            this.Property(t => t.spid).HasColumnName("spid");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.RecordType).HasColumnName("RecordType");
            this.Property(t => t.FormOptions_Height).HasColumnName("FormOptions_Height");
            this.Property(t => t.FormOptions_Width).HasColumnName("FormOptions_Width");
            this.Property(t => t.FormOptions_Columns).HasColumnName("FormOptions_Columns");
            this.Property(t => t.FormOptions_maximized).HasColumnName("FormOptions_maximized");
            this.Property(t => t.FormOptions_Caption).HasColumnName("FormOptions_Caption");
            this.Property(t => t.FormOptions_RowHeight).HasColumnName("FormOptions_RowHeight");
            this.Property(t => t.Page_Name).HasColumnName("Page_Name");
            this.Property(t => t.Page_Order).HasColumnName("Page_Order");
            this.Property(t => t.FieldType_Name).HasColumnName("FieldType_Name");
            this.Property(t => t.FieldType_ControlType).HasColumnName("FieldType_ControlType");
            this.Property(t => t.FieldType_DataType).HasColumnName("FieldType_DataType");
            this.Property(t => t.FieldType_Category).HasColumnName("FieldType_Category");
            this.Property(t => t.FieldType_order).HasColumnName("FieldType_order");
            this.Property(t => t.FieldType_Length).HasColumnName("FieldType_Length");
            this.Property(t => t.FieldType_ValueList).HasColumnName("FieldType_ValueList");
            this.Property(t => t.FieldType_Inactive).HasColumnName("FieldType_Inactive");
            this.Property(t => t.FormOptions_SeperatePages).HasColumnName("FormOptions_SeperatePages");
            this.Property(t => t.FormOptions_HidePageTitles).HasColumnName("FormOptions_HidePageTitles");
            this.Property(t => t.FormOptions_GrayPageBack).HasColumnName("FormOptions_GrayPageBack");
            this.Property(t => t.FieldType_PrintOntheSameLine).HasColumnName("FieldType_PrintOntheSameLine");
            this.Property(t => t.FormOptions_SupressEmpty).HasColumnName("FormOptions_SupressEmpty");
            this.Property(t => t.FormOptions_Arabic).HasColumnName("FormOptions_Arabic");
            this.Property(t => t.FormOptions_ReportCode).HasColumnName("FormOptions_ReportCode");
            this.Property(t => t.FormOptions_CustomReport).HasColumnName("FormOptions_CustomReport");
            this.Property(t => t.Page_Columns).HasColumnName("Page_Columns");
            this.Property(t => t.Page_Rowheight).HasColumnName("Page_Rowheight");
            this.Property(t => t.Page_RightBorder).HasColumnName("Page_RightBorder");
            this.Property(t => t.Page_LeftBorder).HasColumnName("Page_LeftBorder");
            this.Property(t => t.Page_TopBorder).HasColumnName("Page_TopBorder");
            this.Property(t => t.Page_BottomBorder).HasColumnName("Page_BottomBorder");
            this.Property(t => t.FieldType_NoteSelectionCode).HasColumnName("FieldType_NoteSelectionCode");
            this.Property(t => t.FieldType_Caption_Supress).HasColumnName("FieldType_Caption_Supress");
            this.Property(t => t.FieldType_Caption_FontSize).HasColumnName("FieldType_Caption_FontSize");
            this.Property(t => t.FieldType_Caption_FontColor).HasColumnName("FieldType_Caption_FontColor");
            this.Property(t => t.FieldType_Caption_FontBold).HasColumnName("FieldType_Caption_FontBold");
            this.Property(t => t.FieldType_Caption_Alignment).HasColumnName("FieldType_Caption_Alignment");
            this.Property(t => t.FieldType_FitColumn).HasColumnName("FieldType_FitColumn");
            this.Property(t => t.FieldType_Caption_Color).HasColumnName("FieldType_Caption_Color");
            this.Property(t => t.FieldType_ShowBullet).HasColumnName("FieldType_ShowBullet");
            this.Property(t => t.FieldType_Sep_Show).HasColumnName("FieldType_Sep_Show");
            this.Property(t => t.FieldType_Sep_Color).HasColumnName("FieldType_Sep_Color");
            this.Property(t => t.FieldType_Sep_Thickness).HasColumnName("FieldType_Sep_Thickness");
            this.Property(t => t.FieldType_NoBorder).HasColumnName("FieldType_NoBorder");
            this.Property(t => t.FieldType_Message).HasColumnName("FieldType_Message");
            this.Property(t => t.FieldType_Data).HasColumnName("FieldType_Data");
            this.Property(t => t.FieldType_ReportCode).HasColumnName("FieldType_ReportCode");
            this.Property(t => t.FieldType_StatsCode).HasColumnName("FieldType_StatsCode");
            this.Property(t => t.FieldType_Height).HasColumnName("FieldType_Height");
            this.Property(t => t.FieldType_ImageFile).HasColumnName("FieldType_ImageFile");
            this.Property(t => t.FieldType_Transparent).HasColumnName("FieldType_Transparent");
            this.Property(t => t.FieldType_Cells).HasColumnName("FieldType_Cells");
            this.Property(t => t.FieldType_Name_Arabic).HasColumnName("FieldType_Name_Arabic");
            this.Property(t => t.FieldType_Visibility).HasColumnName("FieldType_Visibility");
            this.Property(t => t.FieldType_DefaultValue).HasColumnName("FieldType_DefaultValue");
            this.Property(t => t.FieldType_SpinnerIncrement).HasColumnName("FieldType_SpinnerIncrement");
            this.Property(t => t.FieldType_UID).HasColumnName("FieldType_UID");
            this.Property(t => t.FieldType_Private).HasColumnName("FieldType_Private");
            this.Property(t => t.FieldType_Link_Enabled).HasColumnName("FieldType_Link_Enabled");
            this.Property(t => t.FieldType_Link_Object).HasColumnName("FieldType_Link_Object");
            this.Property(t => t.FieldType_Link_Command).HasColumnName("FieldType_Link_Command");
            this.Property(t => t.FieldType_Link_Param1).HasColumnName("FieldType_Link_Param1");
            this.Property(t => t.FieldType_Link_Param2).HasColumnName("FieldType_Link_Param2");
            this.Property(t => t.FieldType_Link_Param3).HasColumnName("FieldType_Link_Param3");
            this.Property(t => t.FieldType_NormalRange_Max).HasColumnName("FieldType_NormalRange_Max");
            this.Property(t => t.FieldType_NormalRange_Min).HasColumnName("FieldType_NormalRange_Min");
            this.Property(t => t.FieldType_Alert).HasColumnName("FieldType_Alert");
            this.Property(t => t.FieldType_TrackHistory).HasColumnName("FieldType_TrackHistory");
            this.Property(t => t.FieldType_Condition_Control).HasColumnName("FieldType_Condition_Control");
            this.Property(t => t.FieldType_Edit_Alignment).HasColumnName("FieldType_Edit_Alignment");
            this.Property(t => t.FieldType_Lookup_Code).HasColumnName("FieldType_Lookup_Code");
            this.Property(t => t.FieldType_Columns).HasColumnName("FieldType_Columns");
            this.Property(t => t.FieldType_GroupCaption_Suppress).HasColumnName("FieldType_GroupCaption_Suppress");
            this.Property(t => t.FormOptions_Background_Image).HasColumnName("FormOptions_Background_Image");
            this.Property(t => t.FormOptions_Imaging_Enabled).HasColumnName("FormOptions_Imaging_Enabled");
            this.Property(t => t.FormOptions_DocMan_Enabled).HasColumnName("FormOptions_DocMan_Enabled");
            this.Property(t => t.FormOptions_ContactMan_Enabled).HasColumnName("FormOptions_ContactMan_Enabled");
            this.Property(t => t.FormOptions_Print_Orientation).HasColumnName("FormOptions_Print_Orientation");
            this.Property(t => t.FormOptions_Workflow_Enabled).HasColumnName("FormOptions_Workflow_Enabled");
            this.Property(t => t.FormOptions_UID).HasColumnName("FormOptions_UID");
            this.Property(t => t.FormOptions_Private).HasColumnName("FormOptions_Private");
            this.Property(t => t.FormOptions_Background_Color).HasColumnName("FormOptions_Background_Color");
            this.Property(t => t.FieldType_ArabicName).HasColumnName("FieldType_ArabicName");
            this.Property(t => t.FieldType_Datafield).HasColumnName("FieldType_Datafield");
            this.Property(t => t.FormOptions_DataStructure).HasColumnName("FormOptions_DataStructure");
            this.Property(t => t.FormOptions_Table).HasColumnName("FormOptions_Table");
            this.Property(t => t.FieldType_CaptionVisibility).HasColumnName("FieldType_CaptionVisibility");
            this.Property(t => t.FieldType_PrintLayout).HasColumnName("FieldType_PrintLayout");
        }
    }
}
